﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using ChBusiness.Wsbs;
using ChBusiness.FlowOperation;

public partial class Wsbs_ZbsxOperation : System.Web.UI.Page
{
    SerialInstanceOperation sioGloab = new SerialInstanceOperation();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }
    }

    /// <summary>
    /// 获取内容
    /// </summary>
    /// <returns></returns>
    protected string GetContent()
    {
        string strHtml = string.Empty;
        try
        {
            string strServername = Request.Url.Authority;
            string strNewwebdisplay = ConfigurationManager.AppSettings["NewWebDisplay"];
            string strIId = Request["iid"];
            string strTitle = Request["tabname"];

            string strFid = sioGloab.GetFirstFidByWname(Request["tabname"]);
            
            //默认添加权限打开参数--针对webservice2
            if (strNewwebdisplay.IndexOf("?") == -1)
            {
                strNewwebdisplay += "?readonly=false";
            }
            else
            {
                strNewwebdisplay += "&readonly=false";
            }

            strHtml = string.Format("<td id='td{2}' onclick='SetBackColor(this,\"http://{0}{1}&fid={2}&userid=-1&iid={3}&step=-1\",\"{5}\");' class='tabcontrol_button03'>{4}</td>",
                strServername, strNewwebdisplay, strFid, strIId, strTitle, Server.UrlEncode(strTitle));

        }
        catch
        {
        }
        return strHtml;
    }

    /// <summary>
    /// 设置按钮样式
    /// </summary>
    /// <returns></returns>
    protected string GetSubmit()
    {
        string strIid = Request["iid"];
        string strTabName = Request["tabname"];
        string strBtnStyle = string.Empty;

        if (!string.IsNullOrEmpty(strIid))
        {
            ShenBaoSubmit submit = new ShenBaoSubmit();
            string strSubmit = submit.GetZsblSubmitFlag(strIid, Request["flag"]);

            //已经提交
            if (strSubmit == "2")
            {
                strBtnStyle = "disabled='disabled'";
            }
        }
        else
        {
            strBtnStyle = "disabled='disabled'";
        }

        return string.Format(@"<input id='saveform' type='button' value=' 保 存 ' {0} onclick='SaveInfo();' class='zxsbButton'/>&nbsp;<input id='submitform' type='button' value=' 提 交 ' {0} onclick='SubmitInfo(""{1}"",""{2}"");' class='zxsbButton'/>&nbsp;<input id='printform' type='button' value=' 打 印 ' onclick='framePrint()' {0} class='zxsbButton' />", strBtnStyle, strIid, Request["flag"]);

    }
}